package cn.initcap.designpattern.pattern.behavioral.memento;

import java.util.ArrayDeque;
import java.util.Deque;

/**
 * @author initcap
 * @date Created in 2018/10/14 PM8:52.
 */
public class ArticleMementoManager {

    private final Deque<ArticleMemento> ARTICLE_MEMENTO_STACK = new ArrayDeque<>();

    public ArticleMemento getMemento() {
        return ARTICLE_MEMENTO_STACK.pop();
    }

    public void addMemento(ArticleMemento articleMemento) {
        ARTICLE_MEMENTO_STACK.push(articleMemento);
    }

}
